package org.jjliu.example.dao;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.core.type.TypeReference;

public class CriterionModel {
	private Class<?> clazz;
	
	/** 筛选 */
	private List<Filter> filters;

	/** 排序 */
	private List<Order> orders;
	
	
	public CriterionModel(Class<?> clazz) {
		this.clazz = clazz;
		filters = new ArrayList<Filter>();
		orders = new ArrayList<Order>();
	}
	
	
	public Class getClazz() {
		return clazz;
	}



	/**
	 * 获取筛选
	 * 
	 * @return 筛选
	 */
	public List<Filter> getFilters() {
		return filters;
	}

	/**
	 * 设置筛选
	 * 
	 * @param filters
	 *            筛选
	 */
	public CriterionModel setFilters(List<Filter> filters) {
		this.filters = filters;
		return this;
	}

	/**
	 * 获取排序
	 * 
	 * @return 排序
	 */
	public List<Order> getOrders() {
		return orders;
	}

	/**
	 * 设置排序
	 * 
	 * @param orders
	 *            排序
	 */
	public CriterionModel setOrders(List<Order> orders) {
		this.orders = orders;
		return this;
	}

	/**
	 * 添加筛选
	 * @param filter
	 * @return
	 */
	public CriterionModel addFilter(Filter filter){
		filters.add(filter);
		return this;
	}
	/**
	 * 添加排序
	 * @param order
	 * @return
	 */
	public CriterionModel addOrder(Order order){
		orders.add(order);
		return this;
	}

	
}
